trueeasyfandomcom-20200214-history
Plex Media Server
First off, navigate to your FreeNAS WebUI in your browser. Next, click on the "Jails" button on the top bar, and then click on the "Configuration" tab. From there, select a "Jail Root" that is suitable to where you want your jails to be stored. Then click on "Advanced Mode" to expose the network settings. Then fill in the network settings to match your environment. Then click on "Save". Next, click on the "Jails" tab and then click on the "Add Jails" button. From there, a window will popup with options to configure your jail. Click on "Advanced Mode". Then select the following options: Jail Name: plex IPv4 Address: '192.168.x.x (Anything that isn't taken and isn't in your DHCP scope) '''Autostart: '''Checked (default) '''VIMAGE: '''Checked (default) Then click "'Ok". For more information on creating jails in FreeNAS, visit: http://doc.freenas.org/9.10/jails.html#adding-jails Once the jail is created, navigate to a shell prompt, either through the FreeNAS WebUI Shell or via SSH. Once at a shell prompt, view the currently installed jails with the following command: jls You should see something like this: Code: JID IP Address Hostname Path 1 - plex /mnt/Jails/plex In this case, the plex jail has a JID of 1, so to get a shell prompt in the jail, use the following command: jexec 1 tcsh Next, to update the jail's packages, run the following command: pkg update && pkg upgrade -y Now, to install Plex, run the following command: pkg install plexmediaserver-plexpass' ' Once that is complete, you need to setup Plex to start automatically when the jail starts with the following command: sysrc plexmediaserver_plexpass_enable=YES Next, start Plex with the following command: service plexmediaserver_plexpass start Plex is now ready to use and you can navigate to it with this URL: http://192.168.x.x:32400/web Once you tie a Plex account with your server, you will be able to access Plex internally and externally via: https://plex.tv/web Accessing Mounted Storage In Your Jail With Plex: To add storage to your FreeNAS Jail, start by following this documentation: http://doc.freenas.org/9.10/jails.html#add-storage After mounting the storage in your jail, it may be tempting to grant your files 777 access to give Plex access to them. With that said, don’t do it; there is an easy work around. Basically, you can add groups to the jail with the same GroupID as the ones on the host system. Once at a shell prompt within the jail, find out what the GroupID is of the group that is assigned permissions on the mount with this command: ls -l /mnt You’ll then see a list of mount points such as this one: Code: drwxrwx---+ 7 1002 1001 8 Mar 3 18:35 Media The column with 1002 is the UserID, and 1001 is the GroupID. If you want Plex to have access to the Media mount, you need need to create the Media group in the jail with a GroupID of 1001, and have the plex user in it. To do this, run the following command (where 1001 is the GroupID): pw groupadd Media -g 1001 && pw usermod plex -G plex,Media After running the command, you can look at the permissions of the mount again by using: ls -l /mnt Now, you should see the following instead: Code: drwxrwx---+ 4 root Media 4 Feb 21 2014 Media Finally, restart Plex: service plexmediaserver restart You are now done. Plex will now have access to the Media mount. Upgrading Plex: When new releases of Plex come out, you may update without losing your data and preferences. To check if a new release of Plex is available, visit this page: http://www.freshports.org/multimedia/plexmediaserver/ First off, stop Plex with the following command: service plexmediaserver stop To actually update Plex, run the following command: pkg update && pkg upgrade multimedia/plexmediaserver Lastly, start Plex again with the following command: 'service plexmediaserver start'